import styled from "styled-components";

import logoPic from "../../statics/imgs/nav-logo.png";

export const HeaderWrapper = styled.div`
  position: relative;
  height: 58px;
  border-bottom: 1px solid #f0f0f0;
`;

export const Logo = styled.div`
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100px;
  height: 56px;
  background: url(${logoPic});
  background-size: contain;
`;

export const Nav = styled.div`
 width: 960px;
 height: 100%;
 margin: 0 auto;
`;

export const NavItem = styled.div`
  line-height: 56px;
  padding: 0 15px;
  font-size: 17px;
  color: #333;
  &.left{
    float:left;
  }
  &.right{
    float:right;
    color: #969696;
  }
  &.active{
    color: #ea6f5a;
  }
  .icon-zimu{
    font-size: 22px;
  }
  .login{
    text-decoration: none;
    color: #333;
  }
  &.logout{
    cursor: pointer;
  }
`;

export const SearchWrapper = styled.div`
  float: left;
  position: relative;
  .icon-sousuo {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 15px;
    font-size: 22px;
  }
  &.focused{
    .icon-sousuo {
      background-color: #969696;
      border-radius: 50%;
      color: #fff!important;
    }
  }
`;

export const NavSearch = styled.input.attrs({
  placeholder: '搜索'
})`
  &.slide-enter {
    transition: all .2s ease-out;
  }
  &.slide-enter-acitve {
    width: 240px;
  }
  &.slide-exit {
    transition: all .2s ease-out;
  }
  &.slide-exit-acitve {
    width: 160px;
  }
  width: 160px;
  height: 38px;
  padding: 0 40px 0 20px;
  box-sizing: border-box;
  margin-top: 10px;
  margin-left: 20px;
  border: none;
  outline: none;
  border-radius: 19px;
  background: #eee;
  font-size: 14px;
  &::placeholder: {
    color: #999;
  }
  &.focused{
    width: 240px;
  }
`;

export const SearchInfo = styled.div`
  position: absolute;
  left: 0;
  top: 56px;
  width: 240px;
  padding: 0 20px;
  box-shadow: 0 0 8px rgba(0, 0, 0, .2);
  background: #fff;
`;

export const SearchInfoTitle = styled.div`
  margin-top: 20px;
  margin-bottom: 15px;
  line-height: 20px;
  font-size: 14px;
  color: #969696;
`;

export const SearchInfoRefresh = styled.span`
  float: right;
  font-size: 13px;
  cursor: pointer;
  .icon-shuaxin{
    margin-right: 5px;
    display: inline-block;
    vertical-align: top;
    transition: all .2s ease-in;
    transform: rotate(20deg);
    transform-origin: center center;
  }
`;

export const SearchInfoList = styled.div`
  overflow: hidden;
`;

export const SearchInfoItem = styled.a.attrs({
  href: '#'
})`
  text-decoration: none;
  display: block;
  float: left;  
  line-height: 20px;
  padding: 0 5px;
  margin-right: 10px;
  margin-bottom: 15px;
  font-size: 12px;
  border: 1px solid #ddd;
  color: #787878;
  border-radius: 3px;
`;

